<template>
  <div id="head-tabar">
    <div style="float: left;margin-left:100px ">
      <h3 style="color: white">{{ school }}</h3>
    </div>
    <div style="float: right;margin-right: 200px">
      <!--      <h3 style="color: white"></h3>-->
      <el-dropdown style="color: white;font-size: 20px;margin-top: 17px">
      <span class="el-dropdown-link">
        {{ name }}<i class="el-icon-arrow-down el-icon--right"></i>
      </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item icon="el-icon-user-solid" @click.native="toUserInfo()">个人资料</el-dropdown-item>
          <el-dropdown-item icon="el-icon-close" @click.native="loginout()">退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
      <el-avatar :src="require(`@/assets/${headImg}`)" style="margin-left:20px;top:10px;float: left;position: absolute"></el-avatar>
    </div>
  </div>
</template>

<script>
export default {
  name: "HeadTabar",
  data() {
    return {
      school: localStorage.getItem("schoolName"),
      name: localStorage.getItem("userName"),
      headicon: '',
      headImg: localStorage.getItem('userHead'),
    }
  },
  methods:{
    toUserInfo(){
      this.$router.push('/Home/UserInfo')
    },
    loginout(){
      this.$router.push('/Login')
    }
  }
}
</script>

<style scoped>
#head-tabar {
  background: #636363;
  /*background-image: url("../assets/headbar.jpg");*/
  /*background-size: 100% 100%;*/
  width: 100%;
  height: 70px;
  position: absolute;
}


</style>
